package com.example.backupgeo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Column;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    private String userId;
    private String userName;
    private String password;
    private String userRealName;
    private String userImg;
    private int age;
    private String nickname;
    private String userMobile;
    private String userSex;
    private String role;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "userBirth")
    private LocalDateTime userBirth;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "userRegtime")
    private LocalDateTime userRegtime;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
//    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "userModtime")
    private LocalDateTime userModtime ;
    private String userEmail;

    @Override
    public String toString() {
        return "User [userId=" + userId +
                ", userName=" + userName +
                ", password=" + password +
                ", age=" + age +
                ", author=" + "]";
    }

}
